﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ThemSanPham.ascx.cs" Inherits="ThemSanPham" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<%@ Register Src="../Common/ImagePath.ascx" TagName="ImagePath" TagPrefix="uc1" %>

<script src="../Javascripts/Admin/jquery.multiFieldExtender.packed.js" type="text/javascript"></script>

<script type="text/javascript">
   $(document).ready(function () {
    $(".priceDetails").EnableMultiField({      
            linkText: 'Thêm',
            linkClass: 'addMoreFields',
            enableRemove: true,
            removeLinkText: 'Xóa',
            removeLinkClass: 'removeFields',
            confirmOnRemove: true,
            confirmationMsgOnRemove: 'Bạn có muốn xóa nhóm giá này không?',
            addEventCallback: null,
            removeEventCallback: null,
            maxItemsAllowedToAdd: 20,
            maxItemReachedCallback: null
        });        
        var gias = new Array();
        var soluongs = new Array();
        <%=banggia %>
        $("#txtSoLuong").val(soluongs[0]);
        $("#txtGia").val(gias[0]);
        for(i=1; i<gias.length;i++)
        {
            $(".addMoreFields").click();            
            $("#txtSoLuong_" + (i-1)).val(soluongs[i]);
            $("#txtGia_" + (i-1)).val(gias[i]);
        }
    });
</script>

<table cellpadding="0" cellspacing="0" width="100%" class="admintable">
    <tr runat="server" visible="false">
        <td class="lable">
            Ngôn ngữ:
        </td>
        <td>
            <asp:DropDownList ID="cmbLanguage" runat="server" Width="112px" AutoPostBack="True"
                OnSelectedIndexChanged="cmbLanguage_SelectedIndexChanged">
                <asp:ListItem Text="Vietnamese" Selected="True" Value="vi-VN"></asp:ListItem>
                <asp:ListItem Value="en-US">English</asp:ListItem>
            </asp:DropDownList>
        </td>
    </tr>
    <tr>
        <td class="lable">
            Nhóm sản phẩm: <span style="color: red"><strong>(*)</strong></span>
        </td>
        <td>
            <asp:DropDownList ID="cmbNhomSanPham" runat="server" Width="230px">
            </asp:DropDownList>
            &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="cmbNhomSanPham"
                ErrorMessage="Chọn nhóm sản phẩm" SetFocusOnError="True"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td class="lable">
            Tên sản phẩm: <span style="color: red"><strong>(*)</strong></span>
        </td>
        <td>
            <asp:TextBox ID="txtTitle" runat="server" Width="225px"></asp:TextBox>
            &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtTitle"
                ErrorMessage="Nhập tên sản phẩm" SetFocusOnError="True"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td class="lable">
            Mã sản phẩm:
        </td>
        <td>
            <asp:TextBox ID="txtMaSanPham" runat="server" Width="225px"></asp:TextBox>
        </td>
    </tr>
    <tr id="Tr1" runat="server">
        <td class="lable">
            Hãng sản xuất:
        </td>
        <td>
            <asp:DropDownList ID="cmbNhaSanXuat" runat="server" Width="230px">
            </asp:DropDownList>
        </td>
    </tr>
    
    <tr>
        <td class="lable" valign="top">
            Số lượng còn:
        </td>
        <td>
            <asp:TextBox ID="txtSoLuongCon" runat="server" Width="225px"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td class="lable" valign="top">
            Giá sản phẩm:
        </td>
        <td>
            <asp:TextBox ID="txtPrice" runat="server" Width="225px"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td class="lable" valign="top">
            Nhóm giá:
        </td>
        <td>
            <p class="priceDetails" style="margin: 5px;">
                Số lượng:
                <input id="txtSoLuong" name="txtSoLuong" type="text" />
                Giá:
                <input id="txtGia" name="txtGia" type="text" />
            </p>
        </td>
    </tr>
    <tr>
        <td class="lable">
        </td>
        <td valign="top">
            <table style="width: 100%;">
                <tr>
                    <td valign="top" style="width: 140px;">
                        <uc1:ImagePath ID="ImageThumbnail" runat="server" MediaTitle="Hình ảnh nhỏ" RequiredFieldValidator="True" />
                    </td>
                    <td valign="top" style="width: 140px;">
                        <uc1:ImagePath ID="ImageFull" runat="server" MediaTitle="Hình ảnh lớn" RequiredFieldValidator="true" />
                    </td>
                    <td>
                        <span class="headertext">Mô tả ngắn:</span>
                        <FCKeditorV2:FCKeditor ID="txtTrichDan" runat="server" BasePath="~/fckeditor/" Height="120px"
                            Width="100%" ToolbarSet="Basic">
                        </FCKeditorV2:FCKeditor>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td class="lable" valign="top">
            Mô tả sản phẩm: <strong><span style="color: #ff0000">(*)</span></strong>
        </td>
        <td>
            <FCKeditorV2:FCKeditor ID="txtContent" runat="server" BasePath="~/fckeditor/" Height="450px"
                Width="100%" Value="">
            </FCKeditorV2:FCKeditor>
        </td>
    </tr>
    <tr>
        <td class="lable">
            Trạng thái:
        </td>
        <td>
            <asp:DropDownList ID="cmbStatus" runat="server">
                <asp:ListItem Text="" Value="2" Selected="True"></asp:ListItem>
                <asp:ListItem Text="Sản phẩm mới" Value="0"></asp:ListItem>
                <asp:ListItem Text="Sản phẩm tiêu biểu" Value="1"></asp:ListItem>
            </asp:DropDownList>
        </td>
    </tr>
    <tr runat="server" visible="false">
        <td class="lable">
            Vị trí:
        </td>
        <td>
            <asp:TextBox ID="txtOrderId" runat="server" Width="61px">0</asp:TextBox>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtOrderId"
                ErrorMessage="Giá trị phải là số" SetFocusOnError="True" ValidationExpression="[0-9]*"></asp:RegularExpressionValidator>
        </td>
    </tr>
</table>
